<ui:composition 
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:q="http://huliqing.name/qfaces"
    xmlns:b="http://huliqing.name/qblog"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    template="/WEB-INF/template/layout_system.xhtml">

    <ui:define name="subTabName">
        <c:set var="subTabName" value="moduleList" />
    </ui:define>

    <ui:define name="menuTitle">
        <img src="/_res/image/star.png" height="40" style="vertical-align:middle;" alt=""/>
        模块列表
    </ui:define>

    <ui:define name="menuContent">
        <h:outputLink value="/admin/system/processorList.faces">
            <h:outputText value="创建新模块" />
        </h:outputLink>

        <h:form>
            <q:scroller for="mlist"
                        listener="#{moduleListWe.loadData}"
                        var="module"
                        displayJump="false"
                        pageSize="10">
                <h:dataTable id="mlist"
                             binding="#{moduleListWe.uiData}"
                             headerClass="header"
                             border="0"
                             width="100%"
                             styleClass="dotted"
                             rowClasses="row1,row2"
                             columnClasses="oper,alignC,alignC,alignL,alignL"
                             cellspacing="3"
                             cellpadding="3">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="操作" />
                            <h:commandLink action="fix bug：多余的空格存在于首行edit与delete之间。" />
                        </f:facet>
                        <h:outputLink value="/admin/system/moduleEdit.faces" styleClass="marginLR">
                            <f:param name="moduleId" value="#{module.moduleId}" />
                            <f:param name="returnURL" value="#{app.currentURL}" />
                            <h:graphicImage url="/_res/image/button-edit.gif" />
                        </h:outputLink>
                        <h:commandLink action="#{moduleListWe.delete}" onclick="return confirm('您确定要删除这个模块吗？模块：#{module.name}')" styleClass="marginLR">
                            <h:graphicImage url="/_res/image/button-delete.gif" />
                        </h:commandLink>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="标题" />
                        </f:facet>
                        <h:inputText value="#{module.name}" />
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="启用的" />
                        </f:facet>
                        <h:selectBooleanCheckbox value="#{module.enabled}" />
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="渲染器" />
                        </f:facet>
                        <h:outputText value="#{module.processor}" />
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="描述" />
                        </f:facet>
                        <h:outputText value="#{module.des}" />
                    </h:column>
                    <f:facet name="footer">
                        <h:commandButton value="批量更新" action="#{moduleListWe.updateAll}" styleClass="button" />
                    </f:facet>
                </h:dataTable>
            </q:scroller>
        </h:form>

    </ui:define>
</ui:composition>